package com.terry.test1.newd;

import cn.hutool.core.util.ObjectUtil;
import lombok.Getter;

import javax.xml.bind.ValidationException;

public class Name {
    @Getter
    private final String name;
    public Name(String name) throws ValidationException {
        //1.校验name 可通过validation  @Empty实现
        if(ObjectUtil.isEmpty(name)){
            throw new ValidationException("name不能为空");
        }
        this.name = name;
    }
}
